
<template>
  <el-table stripe :data="ningData" style="width: 100%" :header-cell-style="{ background: '#f2f2f2', color: '#333', fontWeight: 600, }">
    <el-table-column label="资源名" align="center"> 
      <template slot-scope="scope">{{ scope.row.sname === null ? '--' : scope.row.sname }}</template>
    </el-table-column>
    <el-table-column prop="discipline" label="学科" width="160" align="center"> 
      <template slot-scope="scope">{{ scope.row.subject == null || scope.row.subject == '' ? '--' : scope.row.subject }}</template>
    </el-table-column>
    <el-table-column label="年级" align="center"> 
      <template slot-scope="scope">{{ scope.row.clas == null || scope.row.clas == '' ? '--' : scope.row.clas}}</template>
    </el-table-column>
    <el-table-column label="累计学习次数" align="center"> 
      <template slot-scope="scope">{{ scope.row.ci === '00分00秒' ? '--' : scope.row.ci }}</template>
    </el-table-column>
    <el-table-column label="累计学习时长" align="center"> 
      <template slot-scope="scope">{{ scope.row.shi == '00分00秒' ? '--' : scope.row.shi }}</template>
    </el-table-column>
    <el-table-column prop="pinshi" label="平均学习时长" align="center"> 
      <template slot-scope="scope">{{ scope.row.pinshi == null ? '--' : scope.row.pinshi }}</template>
    </el-table-column>
    <!-- <el-table-column label="平均完成度%" align="center">
      <template slot-scope="scope"> {{ scope.row.pindu === null ? '--' : scope.row.pindu + '%' }} </template>
    </el-table-column> -->
    <el-table-column label="最近学习时间" align="center"> 
      <template slot-scope="scope">{{ scope.row.xueDate === null ? '--' : scope.row.xueDate }}</template>
    </el-table-column>
    <el-table-column label="操作" width="180" align="center">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.$index , scope.row)" type="text" size="small">详情</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>

export default {
  props: {
    ningData: {
      type: Array,
      default: null,
    },
  },
  methods: {
    handleClick(index,row) {
      this.$emit('toView' ,index, row);
    }
  }
};

</script>

<style scoped>
.el-button.is-disabled{ color: #C0C4CC !important; }
.el-button--small{ font-size: 14px !important; }
.el-button--text{ color: #105CFB !important; }
</style>